package com.demoworld.rocketmq;

import org.apache.rocketmq.client.exception.MQBrokerException;
import org.apache.rocketmq.client.exception.MQClientException;
import org.apache.rocketmq.remoting.exception.RemotingException;

/**
 * Description
 * <p>
 * </p>
 * DATE 2018/8/1.
 *
 * @author liwei5.
 */
public class Application {
    public static RocketmqProducerInfo producerInfo;
    public static RocketmqConsumerInfo consumerInfo;
    public static String topic = "test_topic1";

    static {
        try {
            producerInfo = new RocketmqProducerInfo();
            consumerInfo = new RocketmqConsumerInfo();
        } catch (MQClientException e) {
            e.printStackTrace();
        }
    }

    public static void main(String[] args) throws InterruptedException, RemotingException, MQClientException, MQBrokerException {
        consumerInfo.startUp();
        System.out.println(producerInfo.send("hi", topic));
    }
}
